﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TGMB.aspx.cs" Inherits="TGMB" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <%--<link href="Styles/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link href="Styles/Tracking.Mobile.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jqGrid/i18n/grid.locale-vi.js" type="text/javascript"></script>
    <script src="Scripts/jqGrid/jquerymobile.jqGrid.min.js" type="text/javascript"></script>--%>
    <%= Combres.WebExtensions.CombresLink("CssContent")%>
    <%= Combres.WebExtensions.CombresLink("JsContent")%>
    <table id='grid'></table><div id='pager'></div>
   <script type='text/javascript'>
       jQuery('#grid').jqGrid({
           "hoverrows":false,
           "viewrecords":true,
           "jsonReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},
           "gridview":true,
           "loadonce":true,
           "url":"datav.txt",
           //"scrollPaging":true,
           "iScroll": { "hideScrollbar": true },
           "autowidth":true,
           "rowNum":20,
           "rowList" : [20,40,60],
           "sortname": "OrderID",
           "shrinkToFit": true,
           "height":200,
           "datatype":"json",
           "colModel":[
               { "name": "OrderID", "index": "OrderID", "sorttype": "int", "key": true, "width": 80, "editable": true, "search": true },
               {"name":"OrderDate","index":"OrderDate","sorttype":"datetime","formatter":"date","formatoptions":{"srcformat":"Y-m-d H:i:s","newformat":"m/d/Y"},"editable":true},
               {"name":"ShipName","index":"ShipName","sorttype":"string","editable":true},
               { "name": "Freight", "index": "Freight", "sorttype": "numeric", "editable": true, "search": false }
           ],
           "loadError":function(xhr,status, err){ 
               try {
                   jQuery.jgrid.info_dialog(jQuery.jgrid.errors.errcap,'<div class="ui-state-error">'+ xhr.responseText +'</div>', jQuery.jgrid.edit.bClose,
                       {buttonalign:'right'});
               } catch(e) { 
                   alert(xhr.responseText);} 
           },
           "pager":"#pager"
       });
       jQuery('#grid').jqGrid('filterToolbar', { "stringResult": true });
       
   </script>  
      <script>
          function resizeJqGridWidth(grid_id, div_id, width) {
              $(window).bind('resize', function () {
                  $('#' + grid_id).setGridWidth(width, false); //Back to original width
                  $('#' + grid_id).setGridWidth($('#' + div_id).width(), true); //Resized to new width as per window
              }).trigger('resize');
          }
         // setTimeout("resizeJqGridWidth('grid','content'," + $(window).width() + ")", 1000);   
      </script>
</asp:Content>

